<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            padding:0;
            margin:0;
        }
        p{
            border:1px solid green;
        }
    </style>
</head>
<body>
    <div id="app">
        <form action="https://www.baidu.com/s">
            <input autocomplete="off" name="wd" placeholder="请输入搜索的关键词" type="text">
        </form>

    </div>
    <div id="root"></div>
</body>
<script>
    function fn({g=[]}){
		document.querySelector("#root").innerHTML = g.map(item=>(`
		    <p>${item.q}</p>
		`)).join("")
    }
    // https://www.baidu.com/sugrec?prod=pc&wd=%E5%8A%A8%E6%BC%AB11111&cb=fn
    document.querySelector("input").oninput = function(){
		const script = document.createElement("script");
		script.src = `https://www.baidu.com/sugrec?prod=pc&wd=${this.value}&cb=fn`;
		document.body.appendChild(script);
		document.body.removeChild(script);
    }
</script>
</html>